package org.feng.controller;

import org.feng.customlog.annotation.CustomLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * 测试控制器
 *
 * @version v1.0
 * @author: fengjinsong
 * @date: 2023年06月05日 17时09分
 */
@RestController
public class CustomLogController {

    private static final Logger LOGGER = LoggerFactory.getLogger(CustomLogController.class);

    @CustomLog(desc = "测试hello方法")
    @PostMapping("/hello/{param}")
    public String hello(@PathVariable("param") String param) {
        LOGGER.info("正在执行接口 CustomLogController#hello({})", param);
        String uuid = UUID.randomUUID().toString();
        return uuid + param;
    }
}
